#include "timer.hpp"
#include <iostream>
#include <ctime>

int main()
{
    Timer timer;
    std::cout << "start now: " << std::time(nullptr) << std::endl;
    timer.start(std::chrono::milliseconds(4000), []() {
        std::cout << "start after: " << std::time(nullptr) << std::endl;
    });
    

    while (1) {
        auto b = std::time(nullptr);
        while (std::time(nullptr) - b < 9) {
            continue;    
        }   
        timer.stop();
        break;
    }

    Timer once_timer;
    std::cout << "start_once now: " << std::time(nullptr) << std::endl;
    once_timer.start_once(std::chrono::milliseconds(2000), []() {
        std::cout << "start_once after: " << std::time(nullptr) << std::endl;
    });

    while (1) {

    }

    return 0;
}